




/*
'===============================================================================
'  HNG.Portal.BL.TblSupportOnlineManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using System.Windows.Forms;
namespace HNG.Portal.BLL
{
	public class TblSupportOnlineManagerBase
	{
	    
		#region ColumnNames
		
				public const String Field_Id="Id";
				
				public const String Field_LangId="LangId";
				
				public const String Field_HoTen="HoTen";
				
				public const String Field_DienThoai="DienThoai";
				
				public const String Field_Phone="Phone";
				
				public const String Field_Email="Email";
				
				public const String Field_ChucVu="ChucVu";
				
				public const String Field_TrangThai="TrangThai";
				
				public const String Field_TypeSupport="TypeSupport";
				
				public const String Field_NickSupport="NickSupport";
				
		#endregion	
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		public TblSupportOnlineManagerBase()
		{
			// Nothing for now.
		}
		public DataTable Clone()
		{
			DataTable dt = new DataTable();
						
			
			dt.Columns.Add(Field_Id,typeof(int));
			
						
			
			dt.Columns.Add(Field_LangId,typeof(int));
			
						
			
			dt.Columns.Add(Field_HoTen,typeof(string));
			
						
			
			dt.Columns.Add(Field_DienThoai,typeof(string));
			
						
			
			dt.Columns.Add(Field_Phone,typeof(string));
			
						
			
			dt.Columns.Add(Field_Email,typeof(string));
			
						
			
			dt.Columns.Add(Field_ChucVu,typeof(string));
			
						
			
			dt.Columns.Add(Field_TrangThai,typeof(bool));
			
						
			
			dt.Columns.Add(Field_TypeSupport,typeof(string));
			
						
			
			dt.Columns.Add(Field_NickSupport,typeof(string));
			
			            
            return dt;			
		}
			
		public TblSupportOnlineEntity Convert_Entity(TblSupportOnlineEntity _TblSupportOnlineEntity,TblSupportOnlineEntity _TblSupportOnlineEntity_XML)
		{	
			
				
			_TblSupportOnlineEntity.Id= _TblSupportOnlineEntity_XML.Id;
				
			_TblSupportOnlineEntity.LangId= _TblSupportOnlineEntity_XML.LangId;
				
			_TblSupportOnlineEntity.HoTen= _TblSupportOnlineEntity_XML.HoTen;
				
			_TblSupportOnlineEntity.DienThoai= _TblSupportOnlineEntity_XML.DienThoai;
				
			_TblSupportOnlineEntity.Phone= _TblSupportOnlineEntity_XML.Phone;
				
			_TblSupportOnlineEntity.Email= _TblSupportOnlineEntity_XML.Email;
				
			_TblSupportOnlineEntity.ChucVu= _TblSupportOnlineEntity_XML.ChucVu;
				
			_TblSupportOnlineEntity.TrangThai= _TblSupportOnlineEntity_XML.TrangThai;
				
			_TblSupportOnlineEntity.TypeSupport= _TblSupportOnlineEntity_XML.TypeSupport;
				
			_TblSupportOnlineEntity.NickSupport= _TblSupportOnlineEntity_XML.NickSupport;
				
			
			return _TblSupportOnlineEntity;
		}	
		
			
		public void InsertCollection(EntityCollection _Collection)
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                adapter.SaveEntityCollection(_Collection);
            }
		}

		public TblSupportOnlineEntity Insert(TblSupportOnlineEntity TblSupportOnlineEntity)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(TblSupportOnlineEntity, true);
			}
			return TblSupportOnlineEntity;
		}

		
		public TblSupportOnlineEntity Insert(int Id, int LangId, string HoTen, string DienThoai, string Phone, string Email, string ChucVu, bool TrangThai, string TypeSupport, string NickSupport)
		{
			TblSupportOnlineEntity _TblSupportOnlineEntity = new TblSupportOnlineEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_TblSupportOnlineEntity.Id = Id;
				_TblSupportOnlineEntity.LangId = LangId;
				_TblSupportOnlineEntity.HoTen = HoTen;
				_TblSupportOnlineEntity.DienThoai = DienThoai;
				_TblSupportOnlineEntity.Phone = Phone;
				_TblSupportOnlineEntity.Email = Email;
				_TblSupportOnlineEntity.ChucVu = ChucVu;
				_TblSupportOnlineEntity.TrangThai = TrangThai;
				_TblSupportOnlineEntity.TypeSupport = TypeSupport;
				_TblSupportOnlineEntity.NickSupport = NickSupport;
				adapter.SaveEntity(_TblSupportOnlineEntity, true);
			}
			return _TblSupportOnlineEntity;
		}

		public TblSupportOnlineEntity Insert(int LangId, string HoTen, string DienThoai, string Phone, string Email, string ChucVu, bool TrangThai, string TypeSupport, string NickSupport)
		{
			TblSupportOnlineEntity _TblSupportOnlineEntity = new TblSupportOnlineEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_TblSupportOnlineEntity.LangId = LangId;
				_TblSupportOnlineEntity.HoTen = HoTen;
				_TblSupportOnlineEntity.DienThoai = DienThoai;
				_TblSupportOnlineEntity.Phone = Phone;
				_TblSupportOnlineEntity.Email = Email;
				_TblSupportOnlineEntity.ChucVu = ChucVu;
				_TblSupportOnlineEntity.TrangThai = TrangThai;
				_TblSupportOnlineEntity.TypeSupport = TypeSupport;
				_TblSupportOnlineEntity.NickSupport = NickSupport;
				adapter.SaveEntity(_TblSupportOnlineEntity, true);
			}
			return _TblSupportOnlineEntity;
		}

		public bool Update(TblSupportOnlineEntity _TblSupportOnlineEntity)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(TblSupportOnlineFields.Id == _TblSupportOnlineEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_TblSupportOnlineEntity, filter);
				toReturn = true;
			}
			return toReturn;
		}
		
		public bool Update(TblSupportOnlineEntity _TblSupportOnlineEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_TblSupportOnlineEntity, filter);
				toReturn = true;
			}
			return toReturn;
		}

		public bool Update(int Id, int LangId, string HoTen, string DienThoai, string Phone, string Email, string ChucVu, bool TrangThai, string TypeSupport, string NickSupport)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblSupportOnlineEntity _TblSupportOnlineEntity = new TblSupportOnlineEntity(Id);
				if (adapter.FetchEntity(_TblSupportOnlineEntity))
				{
				
					_TblSupportOnlineEntity.LangId = LangId;
					_TblSupportOnlineEntity.HoTen = HoTen;
					_TblSupportOnlineEntity.DienThoai = DienThoai;
					_TblSupportOnlineEntity.Phone = Phone;
					_TblSupportOnlineEntity.Email = Email;
					_TblSupportOnlineEntity.ChucVu = ChucVu;
					_TblSupportOnlineEntity.TrangThai = TrangThai;
					_TblSupportOnlineEntity.TypeSupport = TypeSupport;
					_TblSupportOnlineEntity.NickSupport = NickSupport;
					adapter.SaveEntity(_TblSupportOnlineEntity, true);
					toReturn = true;
				}
			}
			return toReturn;
		}

		public bool Delete(int Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblSupportOnlineEntity _TblSupportOnlineEntity = new TblSupportOnlineEntity(Id);
				if (adapter.FetchEntity(_TblSupportOnlineEntity))
				{
					adapter.DeleteEntity(_TblSupportOnlineEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", null);
			}
		}
		
		
		public int DeleteById(int Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLangId(int LangId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByHoTen(string HoTen)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.HoTen == HoTen);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByDienThoai(string DienThoai)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.DienThoai == DienThoai);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByPhone(string Phone)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Phone == Phone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByEmail(string Email)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByChucVu(string ChucVu)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.ChucVu == ChucVu);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByTrangThai(bool TrangThai)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TrangThai == TrangThai);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByTypeSupport(string TypeSupport)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TypeSupport == TypeSupport);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByNickSupport(string NickSupport)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.NickSupport == NickSupport);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblSupportOnlineEntity", filter);
			}
			return toReturn;
		}
		

		
		public TblSupportOnlineEntity SelectOne(int Id)
		{
			TblSupportOnlineEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblSupportOnlineEntity _TblSupportOnlineEntity = new TblSupportOnlineEntity(Id);
				if (adapter.FetchEntity(_TblSupportOnlineEntity))
				{
					toReturn = _TblSupportOnlineEntity;
				}
			}
			return toReturn;
		}

		// Return EntityCollection
		public EntityCollection SelectAll()
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection( new TblSupportOnlineEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, null, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}

		
		// Return EntityCollection
		public EntityCollection SelectById(int Id)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(int Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByLangId(int LangId)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLangIdRDT(int LangId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByHoTen(string HoTen)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.HoTen == HoTen);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByHoTenRDT(string HoTen)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.HoTen == HoTen);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByDienThoai(string DienThoai)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.DienThoai == DienThoai);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByDienThoaiRDT(string DienThoai)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.DienThoai == DienThoai);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByPhone(string Phone)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Phone == Phone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByPhoneRDT(string Phone)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Phone == Phone);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByEmail(string Email)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByEmailRDT(string Email)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByChucVu(string ChucVu)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.ChucVu == ChucVu);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByChucVuRDT(string ChucVu)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.ChucVu == ChucVu);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByTrangThai(bool TrangThai)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TrangThai == TrangThai);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByTrangThaiRDT(bool TrangThai)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TrangThai == TrangThai);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByTypeSupport(string TypeSupport)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TypeSupport == TypeSupport);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByTypeSupportRDT(string TypeSupport)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.TypeSupport == TypeSupport);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByNickSupport(string NickSupport)
		{
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.NickSupport == NickSupport);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblSupportOnlineCollection, filter, 0, null);
			}
			return _TblSupportOnlineCollection;
		}
		
		// Return DataTable
		public DataTable SelectByNickSupportRDT(string NickSupport)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblSupportOnlineCollection = new EntityCollection(new TblSupportOnlineEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblSupportOnlineFields.NickSupport == NickSupport);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblSupportOnlineCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		

	}
}
